package test;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main0502 {
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		ArrayList<String>strs=new ArrayList<String>();
		Set<String>strSet=new HashSet<String>();
		while(in.hasNext()){
			String str=in.next();
			if(str.equals("!!!!!"))
				break;
			else if(!(strSet.contains(str)))
				strSet.add(str);
		}
		System.out.println(strSet.size());
		for(String strset:strSet){
			strs.add(strset);
		}
		Collections.sort(strs);
		for(int i=0;i<10;i++){
			System.out.println(strs.get(i));
		}
	}
}
